// SPDX-License-Identifier: Mulan PSL v2
/*
 * Copyright (c) 2025 Huawei Technologies Co., Ltd.
 * This software is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

use std::path::PathBuf;

use walkdir::{DirEntry, WalkDir};

const PROTO_DIR: &str = "./proto";

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // 暂时跳过protobuf编译以避免protoc依赖问题
    // let proto_files: Vec<_> = WalkDir::new(PROTO_DIR)
    //     .into_iter()
    //     .filter_map(|e| e.ok())
    //     .filter(|e| e.path().extension().is_some_and(|ext| ext == "proto"))
    //     .map(DirEntry::into_path)
    //     .collect();
    
    // prost_build::Config::new()
    //     .bytes(["."]) 
    //     .compile_protos(&proto_files, &[PathBuf::from(PROTO_DIR)])?;
    
    println!("cargo:warning=Protobuf compilation is temporarily disabled");

    Ok(())
}
